<template>
  <div class="BashStepForm10">
    <!-- 变更许可人/被许可人名称备案 -->
    <el-form :model="ruleForm" ref="ruleForm" label-width="220px" class="demo-ruleForm" :rules="rules">
      <div class="must">
          <el-form-item label="许可人类型：" prop="picType">
            <el-select v-model="ruleForm.picType"
            @change="changeAplli"
            style="width:80%"
            placeholder="请选择许可人类型">
            <el-option
            v-for="(item,index) in appliPerson"
            :label="item.title"
            :key="index"
            :value="item.value"
            >
            </el-option>
            </el-select>
          </el-form-item>
          <!-- 身份证照片(正反面) -->
          <el-form-item prop="DBupload"
          label="身份证照片(正反面)："
          v-if="ruleForm.picType==1"
          :rules=" {  required: true,validator:DBLicense,trigger: 'change'  }">
          <upfile :callback="DBImageMain" :file_config="{name:3}">
            <img :src="mconfig.host + ruleForm.DBidcardAddr" alt=""  v-if="ruleForm.DBidcardAddr">
          </upfile>
          <div class="exam-img">
            <div class="img-inform">
            <img src="../../assets/imgs/inform.png">
            <span>示例:</span>
            </div>
            <examimg :imgType="1"></examimg>
          </div>
          <span style="color:#f96900">请上传 身份证正反面 清晰图片(jpg,png格式)，图片大小不能超过500k</span>
        </el-form-item>

          <!-- 身份证照片(正面) -->
          <el-form-item prop="uploads"
          label="身份证照片(正面)："
          v-if="ruleForm.picType==1"
          :rules=" {  required: true,validator:idcardAddrLicense,trigger: 'change'  }">
          <upfile :callback="backCardImageMain" :file_config="{name:1}">
            <img :src="mconfig.host + ruleForm.idcardAddr" alt=""  v-if="ruleForm.idcardAddr">
          </upfile>
          <div class="exam-img">
            <div class="img-inform">
            <img src="../../assets/imgs/inform.png">
            <span>示例:</span>
            </div>
            <examimg :imgType="2"></examimg>
          </div>
          <span style="color:#f96900">请上传 身份证正面 清晰图片(jpg,png格式)，图片大小不能超过500k</span>
        </el-form-item>

        <!-- 营业执照 -->
        <el-form-item
        prop="upload"
        label="营业执照："
        v-if="ruleForm.picType==1 || ruleForm.picType==0"
        :rules=" ruleForm.picType == 0 ?{  required: true,validator:bussiAddrLicense,trigger: 'change'  }:[]">
          <upfile :callback="backImage" :file_config="{name:2}">
          <img :src="mconfig.host + ruleForm.picbussi" alt="" v-if="ruleForm.picbussi">
          </upfile>
          <div class="exam-img">
            <div class="img-inform">
            <img src="../../assets/imgs/inform.png">
            <span>示例:</span>
            </div>
            <examimg :imgType="0"></examimg>
          </div>
          <span style="color:#f96900">请上传 营业执照 清晰图片(jpg,png格式)，图片大小不能超过500k</span>
        </el-form-item>

        <!-- 其他合法执照 -->
        <el-form-item
        prop="otherUpload"
        label="其他合法执照："
        v-if="ruleForm.picType==9"
        :rules="{  required: true,validator:otherImgLicense,trigger: 'change'  }">
          <upfile :callback="otherImg" :file_config="{name:9}">
          <img :src="mconfig.host + ruleForm.otherAddr" alt="" v-if="ruleForm.otherAddr">
          </upfile>
          <span style="color:#f96900">请上传 其他合法执照 清晰图片(jpg,png格式)，图片大小不能超过500k</span>
        </el-form-item>

        <el-form-item label="许可人名称：" prop="licensorsCh">
          <el-input v-model="ruleForm.licensorsCh" placeholder="请填写许可人(中文)"></el-input>
          <div class="inform">
          <img src="../../assets/imgs/inform.png" alt="通知" />
          <div class="content">
          <span>示例：张三</span>
          </div>
          </div>
        </el-form-item>

        <el-form-item label="(英文)：">
          <el-input v-model="ruleForm.licensorsEn" placeholder="请填写联系人(英文)"></el-input>
        </el-form-item>

        <el-form-item label="许可人地址：" prop="addrCh">
          <el-input v-model="ruleForm.addrCh" placeholder="请填写许可人地址(中文)"></el-input>
          <div class="inform">
          <img src="../../assets/imgs/inform.png" alt="通知" />
          <div class="content">
          <span>示例：四川省成都市双流区中和大道二段</span>
          </div>
          </div>
        </el-form-item>

        <el-form-item label="(英文)：">
          <el-input v-model="ruleForm.addrEn" placeholder="请填写许可人地址(英文)"></el-input>
        </el-form-item>

        <el-form-item label="是否共有商标：" prop="radio">
          <el-radio  v-model="ruleForm.radio" @change="radioAnniu" :label="1">是</el-radio>
          <el-radio  v-model="ruleForm.radio" :label="0">否</el-radio>
        </el-form-item>

        <el-form-item label="其他共有许可人：" v-if="ruleForm.radio == 1">
          <both
          style="width:80%"
          :callback="getBoth"
          :class_id="$route.query.id"
          :append="$store.state.alterData.append">
          </both>
        </el-form-item>

        <el-form-item label="备案号：" prop="provider">
          <el-input v-model="ruleForm.provider" placeholder="请填写备案号"></el-input>
        </el-form-item>

        <el-form-item label="变更前许可人名称（中文）：" prop="oldnameC">
          <el-input v-model="ruleForm.oldnameC" placeholder="请填写变更前许可人名称（中文）"></el-input>
          <div class="inform">
          <img src="../../assets/imgs/inform.png" alt="通知" />
          <div class="content">
          <span>示例：张三</span>
          </div>
          </div>
        </el-form-item>

        <el-form-item label="（英文）：">
          <el-input v-model="ruleForm.oldnameE" placeholder="请填写变更前许可人名称（英文）"></el-input>
        </el-form-item>

        <el-form-item label="变更前被许可人名称（中文）：" prop="oldlicenseeC">
          <el-input v-model="ruleForm.oldlicenseeC" placeholder="请填写变更前被许可人名称（中文）"></el-input>
          <div class="inform">
          <img src="../../assets/imgs/inform.png" alt="通知" />
          <div class="content">
          <span>示例：张三</span>
          </div>
          </div>
        </el-form-item>

        <el-form-item label="（英文）：">
          <el-input v-model="ruleForm.oldlicenseeE" placeholder="请填写变更前被许可人名称（英文）"></el-input>
        </el-form-item>

        <el-form-item label="变更后被许可人名称（中文）：" prop="newsiteC">
          <el-input v-model="ruleForm.newsiteC" placeholder="请填写变更后被许可人名称（中文）"></el-input>
          <div class="inform">
          <img src="../../assets/imgs/inform.png" alt="通知" />
          <div class="content">
          <span>示例：李四</span>
          </div>
          </div>
        </el-form-item>

        <el-form-item label="（英文）：">
          <el-input v-model="ruleForm.newsiteE" placeholder="请填写变更后被许可人名称（英文）"></el-input>
        </el-form-item>

        <el-form-item label="商标注册/申请号：" prop="applynumber">
          <el-input v-model="ruleForm.applynumber" placeholder="请填写商标申请号/注册号"></el-input>
          <div class="inform">
          <img src="../../assets/imgs/inform.png" alt="通知" />
          <div class="content">
          <span>示例：2515783543</span>
          </div>
          </div>
        </el-form-item>

        <el-form-item class="upload" label="网上确认书：" prop="afterAmount">
          <span id="star">*</span>
          <upfile :callback="setSure">
          <img :src="img_default['qrfile']" v-if="img_default['qrfile']" style="width:148px;height:148px;margin-bottom:10px" />
          </upfile>
          <div class="exam-img">
            <div class="img-inform">
            <img src="../../assets/imgs/inform.png">
            <span>示例:</span>
            </div>
            <examimg :imgType="4"></examimg>
          </div>
          <div>
            <span class="informs">
            请点此<a :href="mconfig.host + '/file/download?fileType=2'">
            下载网上确认书</a>,查到相应商标编号并填充</span>
            <br />
            <span class="notice">
            请将下载的网上确认书填写完成, 然后上传JPG文件或是PNG文件
            </span>
          </div>
        </el-form-item>

        <el-form-item label="其他附件：" prop="dengjichenluofile">
          <uploads :callback="backUrl" :delUrl="delUrl" :file_config="{field:'dengjichenluofile'}" :list="ruleForm.dengjichenluofile"></uploads>
          <div class="inform">
            <img src="../../assets/imgs/inform.png" alt="通知" />
            <div class="content">
              <span>提示：其他附件</span>
            </div>
          </div>
        </el-form-item>

        <el-form-item>
          <div class="btns">
          <el-button type="primary" @click="outStep">上一步</el-button>
          <el-button type="primary" @click="submitCheck('ruleForm')">提交并审核</el-button>
          </div>
        </el-form-item>

        <el-dialog
          width="460px"
          class="dialog"
          :center="true"
          :show-close="false"
          :before-close="handleClose"
          :visible.sync="dialogVisible">
          <div class="hint">
            <img src="../../assets/imgs/branch.png" alt="提示图片" />
            <span>选择您想去办理的网点</span>
          </div>
          <el-form-item label="选择网点：" prop="value" >
            <el-select style="margin-left:-10px" v-model="ruleForm.value" placeholder="请选择">
              <el-option
              :key="item.deptId"
              :value="item.deptId"
              :label="item.deptName"
              v-for="item in options">
              <span style="float: left">{{ item.deptName }}</span>
              <span style="float: right; color: #8492a6; font-size: 13px">{{ item.address }}</span>
              </el-option>
            </el-select>
          </el-form-item>
          <div slot="footer" class="dialog-footer">
          <el-button type="info" @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
          </div>
        </el-dialog>
        <el-dialog
        width="462px"
        class="hintMsg"
        title="温馨提示"
        @close="skip()"
        :show-close="false"
        :visible.sync="centerDialogVisible">
          <span>您的信息已提交，工作人员将在3-5日内对你的信息审核，审核通过后即可预约业务，审核结果将通过短信的方式发送给你。</span>
          <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="skip">确 定</el-button>
          </span>
        </el-dialog>
      </div>
    </el-form>
  </div>
</template>
<script>
import BaseUpload from "./BaseUpload";
import upfile from "../common/upfile.vue"
import { mapState } from "vuex"
import both from "../common/both.vue";
import examimg from "../common/imgExample";
import uploads from "../common/uploads";
export default {
  data() {
    return {
      showImgOne: false,
      showImgTwo: false,
      //显示图片
      showImg: false,
      //网点列表
      options: [],
      //提交成功弹出框变量
      centerDialogVisible: false,
      //网点弹出框控制变量
      dialogVisible: false,
      // 是否上传图片
      uploadImg: false,
      //共有人模板
      common: [],
      //许可人类型
      appliPerson: [],
      //共有人模板
      commonModel:{
        name: "变更前许可人名称(中文)：",
        englishName: "(英文)：",
        site: "变更后许可人名称(中文)：",
        englishSite: "(英文)：",
        value: "",   // 中文名称
        englishValue: "",   // 英文名称
        siteValue: "",   // 中文地址
        englishSiteValue: "",  // 英文地址
      },
      // 实际模板
      modelcommon:{
        partNameCh: "",
        partNameEn: "",
        partAddrCh: "",
        partAddrEn: "",
      },
      commonData:[],
      // add:0,
      //表单唯一id
      classId: "",
      //填写的信息
      ruleForm: {
        // picType: 0,
        // licBusimg:'',
        // licIdcardimg:'',
        imgAddr: "",
        addrCh:"",
        addrEn:"",
        licensorsCh:"",
        licensorsEn:"",
        dengjichenluofile:[],
        // linkman: "",
        // institution: "",
        number: "",
        radio: 0,
        provider: "",
        oldnameC: "",
        oldnameE: "",
        oldlicenseeC: "",
        oldlicenseeE: "",
        newsiteC: "",
        newsiteE: "",
        applynumber: "",
        value: "",
        imgAdd:"",
        commonArr: [],
        picType: 0,  // 申请人类型
        upload:'',
        uploads: "",
        DBupload:"",
        otherUpload:"",
        picdbcard:"",// 身份证正反面
        picidcard: "",// 身份证正面
        picbussi: "",//营业执照
        idcardAddr:"",  // 身份证正面地址
        bussiAddr:"", // 营业执照地址
        otherAddr:"", //其它执照
        DBidcardAddr:"",//身份证正反面
      },

      rules: {
        picType:[{required: true, message: "选项不能为空", trigger: "change"}],
        addrCh: [{ required: true, message: "许可人地址不能为空", trigger: "blur" }],
        radio: [{ required: true, message: "选项不能为空", trigger: "change" }],
        licensorsCh: [
        { required: true, message: "许可人名称不能为空", trigger: "blur" },
        { pattern: /^[\u4E00-\u9FA5]{2,20}$/,
          message: "请输入正确的中文名称",
          trigger: "blur",
        }],

        provider: [{
          required: true,
          message: "请输入备案号",
          trigger: "blur",
        },
        { pattern: /^[A-Za-z0-9]{0,30}$/,
          message: "请输入正确的备案号",
          trigger: "blur",
        }],
        // dengjichenluofile: [
        //   { required: true, message: "附件不能为空", trigger: "change" },
        // ],

        oldnameC: [
        { required: true, message: "选项不能为空", trigger: "blur" },
        { pattern: /^[\u4E00-\u9FA5]{2,20}$/,
          message: "请输入正确的中文名称",
          trigger: "blur",
        }],

        oldlicenseeC: [
        { required: true, message: "选项不能为空", trigger: "blur" },
        { pattern: /^[\u4E00-\u9FA5]{2,20}$/,
          message: "请输入正确的中文名称",
          trigger: "blur",
        }],

        newsiteC: [
        { required: true, message: "选项不能为空", trigger: "blur" },
        { pattern: /^[\u4E00-\u9FA5]{2,20}$/,
          message: "请输入正确的中文名称",
          trigger: "blur",
        }],

        applynumber: [
        { required: true,
          message: "请输入商标申请号",
          trigger: "blur",
        },
        { pattern: /^[A-Za-z0-9]{0,30}$/,
          message: "请输入正确的商标申请号",
          trigger: "blur",
        }],
      },
      img_default: {},
      counts: 0,
    };
  },
  mounted() {
    this.appliPerson = this.mconfig.options;
    //获取从存储在路由中的classId
    this.classId = this.$route.query.id;
    //获取网点列表
    this.$http.get("/trademark/system/dept/findDept").then((res) => {
      this.options = res.data.data;
    });
    if(this.$store.state.stateJdg){
      this.showImgOne = true
      this.showImgTwo = true
      this.uploadImg = true;
      this.showImg = true;
      let {
        addrCh,
        addrEn,
        // contacts,
        licensorsCh,
        licensorsEn,
        nameAgen,
        appCode,
        commStaus,
        recordNo,
        licPicType,
        befLicensorsCh,
        befLicensorsEn,
        befLicenseesCh,
        befLicenseesEn,
        aftLicensorsCh,
        aftLicensorsEn,
        otherfile,
        phoneNum,
        licenseeType,
        businessLicense,
        iddbimage,
        idaddress,
      } = this.$store.state.alterData.data;
        let {
        qrfile,  // 网上确认书
        branchNetworkId,
      } = this.$store.state.alterData.public;

      this.ruleForm.picType = Number(licenseeType)// 许可人类型
      // this.ruleForm.licBusimg = this.mconfig.host+businessLicense,
      // this.ruleForm.commonArr = this.$store.state.alterData.append;
      this.ruleForm.idcardAddr = idaddress,
      this.ruleForm["dengjichenluofile"] = JSON.parse(otherfile);
      this.ruleForm.DBidcardAddr = iddbimage //身份证正反面
      this.ruleForm.picbussi = businessLicense
      this.ruleForm.otherAddr = businessLicense
      this.ruleForm.addrCh = addrCh,
      this.ruleForm.addrEn = addrEn,
      this.ruleForm.licensorsCh = licensorsCh
      this.ruleForm.licensorsEn = licensorsEn
      this.ruleForm.value = Number(branchNetworkId)
      // this.ruleForm.linkman = contacts
      this.ruleForm.radio = Number(commStaus)
      // this.ruleForm.institution = nameAgen
      this.ruleForm.applynumber = appCode
      this.ruleForm.provider = recordNo
      // this.ruleForm.picType = Number(licPicType)
      this.ruleForm.oldnameC = befLicensorsCh
      this.ruleForm.oldnameE = befLicensorsEn
      this.ruleForm.oldlicenseeC = befLicenseesCh
      this.ruleForm.oldlicenseeE = befLicenseesEn
      this.ruleForm.newsiteC = aftLicensorsCh
      this.ruleForm.newsiteE = aftLicensorsEn
      if (qrfile) {
        this.img_default.qrfile = this.mconfig.host + qrfile;
      }
      //回显共有人append
      if (this.$store.state.alterData.append) {
        this.$store.state.alterData.append.forEach((item) => {
          let objCommom = JSON.parse(JSON.stringify(this.modelcommon));
          this.ruleForm.commonArr.push(objCommom);
          let objValue = JSON.parse(JSON.stringify(this.commonModel));
          objValue.value = item.partNameCh;
          objValue.englishValue = item.partNameEn;
          objValue.siteValue = item.partAddrCh;
          objValue.englishSiteValue = item.partAddrEn;
          this.common.push(objValue);
        });
      }
      this.ruleForm.imgAddr = this.mconfig.host + this.$store.state.alterData.public.qrfile

      // this.common = this.$store.state.alterData.append;
      let append = this.$store.state.alterData.append;// 共有人信息json
    }
  },
  watch: {
    //通过数据监听的方式将共有人模板中的信息同步到proAppends中
    common: {
      handler(newName, oldName) {
        this.common.forEach((item, index) => {
          this.ruleForm.commonArr[index].partNameCh = item.value;
          this.ruleForm.commonArr[index].partNameEn = item.englishValue;
          this.ruleForm.commonArr[index].partAddrCh = item.siteValue;
          this.ruleForm.commonArr[index].partAddrEn = item.englishSiteValue;
        });
      },
      deep: true,
    },
    //  监听判断是否执行新增变更人
    // "ruleForm.radio":function(val){
    //     if(val == 1){
    //       if(this.ruleForm.commonArr.length == 0 || this.$store.state.stateJdg==false){
    //             this.plus()
    //       }
    //     }else{ this.ruleForm.commonArr == [] }
    // }
  },
  computed:{
    ...mapState(["stateJdg", "alterData"])
  },
  methods: {
    backUrl(url,file_config){
        this.ruleForm[file_config["field"]].push(url)
    },
    delUrl(index,file_config){
        this.ruleForm[file_config["field"]].splice(index,1)
        this.$set(this.ruleForm,file_config["field"],this.ruleForm[file_config["field"]])
    },
    getBoth(value){
        console.log(value,145645)
        this.commonData = value;
    },
    idcardAddrLicense(rule, value, callback) { //验证规则
        if (this.ruleForm.idcardAddr) {
            callback();
        } else {
            callback(new Error("请上传身份证证件"));
        }
    },
    DBLicense(rule, value, callback) { //验证规则
        if (this.ruleForm.DBidcardAddr) {
            callback();
        } else {
            callback(new Error("请上传身份证正反面"));
        }
    },
    bussiAddrLicense(rule, value, callback) { //验证规则
      if (this.ruleForm.picType==0) {
        if (this.ruleForm.picbussi) {
            callback();
        } else {
            callback(new Error("请上传营业执照"));
        }
      }
    },
    otherImgLicense(rule, value, callback) { //验证规则
        if (this.ruleForm.otherAddr) {
            callback();
        } else {
            callback(new Error("请上传其他合法执照"));
        }
    },
    changeAplli(){
      console.log(this.ruleForm.picType)
      this.ruleForm.addrCh = '';
      this.ruleForm.licensorsCh = '';
      this.ruleForm.idcardAddr = '';
      this.ruleForm.DBidcardAddr = '';
      this.ruleForm.picbussi = '';
      this.ruleForm.otherAddr = '';
    },
    backImage(files) {
      let data = new FormData();
      this.ruleForm.picbussi = files;
      this.ruleForm.upload = "1"
      if(this.ruleForm.picType != 9){
        data.append(
        "picbussi",this.ruleForm.picbussi[0] ? this.ruleForm.picbussi[0] : "");
      }
      data.append("picType", this.ruleForm.picType);
      let config = {
        headers: {
          "Content-Type": "multipart/form-data",
        }
      };
      this.$http.post("/trademark/distinguish/picdis", data, config)
      .then((res) => {
        if(this.ruleForm.picType==0){
            this.ruleForm.addrCh = res.data.data.po.address;
            this.ruleForm.licensorsCh = res.data.data.po.name;
            this.$set(this.ruleForm,'picbussi',res.data.data.popath)
        }else if(this.ruleForm.picType==1){
          this.$set(this.ruleForm,'picbussi',res.data.data.popath)
        }
      })
    },
    DBImageMain(files) {
      let data = new FormData();
      this.ruleForm.picdbcard = files;
      this.ruleForm.DBupload = "1"
      if(this.ruleForm.picType == 1){
        data.append(
        "picdbcard",
        this.ruleForm.picdbcard[0] ? this.ruleForm.picdbcard[0] : "");
      }
      data.append("picType", this.ruleForm.picType);
      let config = {
        headers: {
        "Content-Type": "multipart/form-data",
        }
      };
      this.$http.post("/trademark/distinguish/picdis", data, config)
      .then((res) => {
        this.$set(this.ruleForm,'DBidcardAddr',res.data.data.picpath);
      })
    },
    backCardImageMain(files){
      let data = new FormData();
      this.ruleForm.picidcard = files;
      this.ruleForm.uploads = "1"
      if(this.ruleForm.picType == 1){
        data.append(
        "picidcard",
        this.ruleForm.picidcard[0] ? this.ruleForm.picidcard[0] : "");
      }
      data.append("picType", this.ruleForm.picType);
      let config = {
        headers: {
          "Content-Type": "multipart/form-data",
        }
      };
      this.$http.post("/trademark/distinguish/picdis", data, config)
      .then((res) => {
        if(this.ruleForm.picType==1){
        this.ruleForm.addrCh = res.data.data.pic.address;
        this.ruleForm.licensorsCh = res.data.data.pic.name;
        this.$set(this.ruleForm,'idcardAddr',res.data.data.id_card)
        }
      })
    },
    otherImg(files){
      let data = new FormData();
      this.ruleForm.otherAddr = files;
      this.ruleForm.otherUpload = "1"
      if(this.ruleForm.picType == 9){
        data.append(
        "picbussi",this.ruleForm.otherAddr[0] ? this.ruleForm.otherAddr[0] : "");
      }
      data.append("picType", this.ruleForm.picType==1?1:0);
      let config = {
        headers: {
          "Content-Type": "multipart/form-data",
        }
      };
      this.$http.post("/trademark/distinguish/picdis", data, config)
      .then((res) => {
        if(this.ruleForm.picType==9){
          this.$set(this.ruleForm,'otherAddr',res.data.data.popath)
        }
      })
    },

    // 提交并审核验证
    submitCheck(formName) {
      if(this.ruleForm.radio==1){
        if (this.commonData.length == 0) { //没填共有人
          this.open1("请填写共有人信息！", "error");
          return;
        }
      }

      this.$refs[formName].validate((valid) => {
        if (valid && this.uploadImg == true) {
          this.dialogVisible = true;
        }
        else if (this.uploadImg == false) {
          this.open1("请上传网上确认书", "error");
        }
        else {
          this.open1("请完整填写表单数据", "error");
        }
      });
    },

    // 上传网上确认书
    setSure(files){
      if(files.length > 0){
        this.uploadImg = true
        this.ruleForm.qrfile=files[0]
        this.showImg = false
      }else{
        this.uploadImg = false
        this.ruleForm.qrfile = ""
      }
      this.img_default = {};
    },

    //返回上一步
    outStep() {
      this.$emit("wp", 1, "请填写申请业务信息");
    },

    //提示模板
    open1(msg, types = "success") {
      this.$message({
        message: msg,
        type: types,
      });
    },

    //弹出框的选项确认框
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
        })
        .catch((_) => {});
    },
    //表单提交事件
    submitForm(formName) {
      let _this = this;
        if (this.ruleForm.value != "") {
          //每次提交重新生成新的FormData用于储存新的数据
          var formData = new FormData();
          this.dialogVisible = false;
          /*********************************************公共数据开始*********************************************/
          let arr=this.$store.getters.getRuleForm
          for(let key in arr){
            formData.append(key,arr[key])
          }

          /*********************************************公共数据结束*********************************************/

          /*********************************************需要提交的数据开始***************************************/

          //我的
          formData.append(
            "proAppends",
            JSON.stringify(this.commonData) // 其他共有人
          );
          console.log(this.ruleForm.value);
          formData.append("branchNetworkId", Number(this.ruleForm.value)); // 网点编号
          // formData.append("contacts", this.ruleForm.linkman); // 联系人
          formData.append("licensorsCh", this.ruleForm.licensorsCh); // 许可人名称
          formData.append("licensorsEn", this.ruleForm.licensorsEn); // 许可人名称(英文)
          formData.append("addrCh", this.ruleForm.addrCh); // 许可人地址
          formData.append("addrEn", this.ruleForm.addrEn); // 许可人地址(英文)
          // formData.append("nameAgen", this.ruleForm.institution); // 代理机构名称
          formData.append("commStaus", this.ruleForm.radio); // 是否共有商标
          formData.append("recordNo", this.ruleForm.provider); // 备案号
          formData.append("befLicensorsCh", this.ruleForm.oldnameC); // 变更前被许可人名称（中文）
          formData.append("befLicensorsEn", this.ruleForm.oldnameE); // 变更前被许可人名称（英文）
          formData.append("befLicenseesCh", this.ruleForm.oldlicenseeC); // 变更前许可人名称（中文）
          formData.append("befLicenseesEn", this.ruleForm.oldlicenseeE); // 变更前许可人名称（英文）
          formData.append("aftLicensorsCh", this.ruleForm.newsiteC); // 变更后许可人名称（中文）
          formData.append("aftLicensorsEn", this.ruleForm.newsiteE);// 变更后许可人名称（英文）
          formData.append("appCode", this.ruleForm.applynumber); // 商标注册号
          formData.append("licenseeType", this.ruleForm.picType); // 许可人类型
          formData.append("IDAddress", this.ruleForm.idcardAddr); // 身份证地址
          formData.append("iddbimage", this.ruleForm.DBidcardAddr); // 身份证正反面地址
          formData.append("otherfile", JSON.stringify(this.ruleForm.dengjichenluofile)); //其他出质人
          formData.append("businessLicense", this.ruleForm.picbussi?this.ruleForm.picbussi:this.ruleForm.otherAddr); // 营业执照地址

          if(this.showImg){
            formData.append("qrfiles", {}); // 如果没有修改, 则使用之前的qrfile
          }else{
            formData.append("qrfiles",this.ruleForm.qrfile); // 网上确认书
          }

          formData.append("id", this.$store.state.storeId);
          formData.append("classId", this.classId);
          if(this.$store.state.stateJdg){
            formData.append("modelId", this.$store.state.alterData.public.modelId)
          }
          /*********************************************需要提交的数据结束**************************************/

          //配置请求头
          var config = {
            header: {
            "Content-Type": "multipart/form-data",
            },
          };
          this.$http
            .post(this.$store.state.stateJdg?"/trademark/proTChLicensors/modifyNoCommit":"/trademark/proTChLicensors/firstSubmit", formData, config)
            .then(function (response) {
              //若状态码不为200则不跳转
              if (response.data.code != 200) {
                _this.open1("提交失败", "error");
                return;
              }
              _this.centerDialogVisible = true;
            })
            .catch(function (error) {});
        } else {
          this.open1("请选择网点编号", "error")
          return false;
        }
    },
    dele() {
      this.common.pop();
      this.ruleForm.commonArr.pop();
      if (this.common.length == 0) {
        this.ruleForm.radio = 0;
      }
    },

    //点击添加更变许可人
    plus() {
      let objCommom = JSON.parse(JSON.stringify(this.modelcommon));
      this.ruleForm.commonArr.push(objCommom);
      let objValue = JSON.parse(JSON.stringify(this.commonModel));
      this.common.push(objValue);
    },
    radioAnniu() {
      if (this.ruleForm.radio == 1) {
        if (this.common.length == 0) {
          this.plus();
          return
        }
      }
    },

    //跳转函数
    skip() {
      this.centerDialogVisible = false;
      this.open1("操作成功");
      this.$router.push({
        path: "/business/myBusiness/auditing",
      });
    },

    //重置表单函数(没用上)
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
  },

  //挂载
  components: {
    BaseUpload,upfile,both,examimg,uploads
  },
};
</script>
<style lang="less" scoped>
.btns {
  display: flex;
  justify-content: center;
  .el-button {
    margin: 0 20px;
  }
}
.box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 800px;
  .tle {
    font-size: 24px;
    color: #000;
  }
  .el-form {
    width: 100%;
    .el-input {
      width: 80%;
    }
  }
  .must,
  .select {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0 30px;
    margin-bottom: 80px;
    border-radius: 10px;
    .el-form-item {
      width: 680px;
    }
    .inline {
      display: flex;
      .el-form-item {
        margin: 0;
        width: 290px !important;
      }
    }
  }
  .must {
    margin-bottom: 20px;
  }
  .line {
    width: calc(100% - 280px);
    margin: 10px auto;
    height: 1px;
    border-top: 1px dashed #d9d9d9;
  }
  .imgHint {
    margin: 5px;
    font-size: 12px;
    line-height: 17px;
    color: #F96900;
  }
  .affirm {
    font-size: 12px;
    color: #a0a3a5;
    a {
      text-decoration: none;
      color: #3685ff;
    }
  }
  .input {
    width: 190px;
  }
  .upload {
    margin: 20px 0;
  }
  .type-number {
    width: 250px;
  }
  .informs {
    position: absolute;
    width: 500px;
    font-size: 12px;
    color: #a0a3a5;
    a {
      text-decoration: none;
      color: #3685ff;
    }
  }
  .notice {
    color: #F96900;
    font-size: 12px;
  }
  .inform {
    display: flex;
    align-items: center;
    position: absolute;
    top: 0;
    left: 80%;
    width: 300px;
    height: 32px;
    color: #F96900;
    font-size: 10px;
    line-height: 14px;
    img {
      margin: 11px;
    }
    .content {
      display: flex;
      flex-direction: column;
      .ts {
        text-indent: 3em;
      }
    }
  }
  .tle {
    list-style: none;
    margin: 40px 0 20px;
    font-size: 24px;
    & ~ .tle {
      color: #bbb;
    }
  }
  .hint {
    color: #F96900;
    background-color: #fff;
    .el-form-item__label {
      width: 150px;
    }
    img {
      width: 20px;
    }
  }
  .el-steps {
    width: 70%;
    height: 200px;
  }
  .el-button {
    display: inline;
    margin: 0 20px;
  }

  .common .el-button {
    background-color: #fff !important;
    border-color: #bbb !important;
  }
}
.dialog-footer {
  display: flex;
  justify-content: space-between;
  color: #fff;
  .lan {
    background-color: #2c9dfc !important;
    border-color: #2c9dfc !important;
  }
}

.dialog /deep/.el-form-item__label {
  width: 100px !important;
}
.dialog /deep/.el-form-item__content {
  margin-left: 100px !important;
  display: flex;
  justify-content: left;
}
.dialog /deep/.el-input {
  width: 250px;
}
.el-checkbox-group {
  line-height: 14px;
}
.el-radio/deep/.el-radio__inner:hover {
  border-color: #999999 !important;
}
.is-checked/deep/.el-radio__label,
.is-checked/deep/.el-checkbox__label {
  color: #333;
}
.is-focus .el-checkbox__inner {
  border-color: #999999 !important;
}
.el-checkbox/deep/.el-checkbox__inner:hover {
  border-color: #999999 !important;
}
.el-step__head.is-process {
  border-color: #f96900;
  color: #f96900 !important;
}
.hintMsg {
  /deep/.el-dialog__header {
    display: flex;
    justify-content: center;
    font-weight: bold;
  }
  .dialog-footer {
    justify-content: center;
    .el-button {
      border-color: #2c9dfc !important;
      background: #2c9dfc !important;
    }
  }

}
/deep/ .el-dialog.el-dialog--center /deep/ {
    .el-dialog__header {
        padding: 0;
    }

    .el-dialog__body {
        padding: 20px 20px 50px;
    }

    .hint {
        color: #F96900;
        background-color: #fff;
        padding: 0;
        padding-bottom: 20px;
    }

    .el-button {
        margin: 0;
    }

    .el-form-item__label {
        width: 86px !important;
    }
}
#star{
  position: absolute;
  color: red;
  margin-left: -105px;
}
.exam-img{
  position: absolute;
  top: 0;
  left: 450px;
}
.img-inform{
  img{
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -140px;
    transform: translate(-50%,-50%);
  }
  span{
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      white-space: nowrap;
      margin-left: -100px;
      width: 50px;
      color: #f96900;
  }
}
</style>
